< previous page page_145 next page >

Page 145
Examples Filename: Employee.frm
In the Save command button, youll find code that grabs the data from the form and puts it in a module-level variable thats declared as Employee_Type. All youre going to do right now is to put the data in and then display some of the data back from the user-defined type variable. Although this is not a real useful example, it does show you the syntax you use when working with a user-defined type:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdSave_Click()
   mtypEmp.strFirst = txtFirst.Text
   mtypEmp.strLast = txtLast.Text
   mtypEmp.strStreet = txtAddress.Text
   mtypEmp.strCity = txtCity.Text
   mtypEmp.strState = cboState.Text
   mtypEmp.strZip = txtZip.Text
   mtypEmp.strSSN = txtSSN.Text
   mtypEmp.boolBonus = chkBonus.Value

   MsgBox "Name = " & mtypEmp.strLast & _
          ", " & mtypEmp.strFirst
End Sub
8160-0145a.gif
Figure 7.3
User-defined type example.

 
< previous page page_145 next page >

If you like this book, buy it!